import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { createPinia } from 'pinia'
import './styles/base.css'

if (!window.katex) window.katex = {};
window.katex.strict = "ignore"; // 禁止任何 warn/error

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 全局挂载axios
import axios from './utils/axios'


// 引入Vant组件库
import Vant from 'vant'
import 'vant/lib/index.css'

import { MdEditor } from 'md-editor-v3'
import 'md-editor-v3/lib/style.css'

import '@fortawesome/fontawesome-free/css/all.css'
const pinia = createPinia()

import 'amfe-flexible'

const app = createApp(App)
// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.component('MdEditor', MdEditor) // 全局注册组件
app.use(router)
app.use(pinia)
app.use(ElementPlus)
app.use(Vant)
app.use(axios)
app.mount('#app')